using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class MsgServiceMap : EntityTypeConfiguration<MsgService>
    {
        public MsgServiceMap()
        {
            // Primary Key
            this.HasKey(t => t.ServiceID);

            // Properties
            this.Property(t => t.Title)
                .HasMaxLength(50);

            this.Property(t => t.Creator)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("MsgService");
            this.Property(t => t.ServiceID).HasColumnName("ServiceID");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.Creator).HasColumnName("Creator");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
